<?phpdefine ("MAPNAME_EXISTS",-2);class dbaCMSImageMap{	function dbaCMSImageMap(&$dba)	{		$this->dba = &$dba;	}	function addMap ($name, $doc_id, $image)	{			$this->dba->query("select * from ".$this->dba->tableforwarder."_cmsImageMap where name=".$this->dba->quote($name));		if ($this->dba->num_rows()<1)		{			return $this->dba->query("insert into ".$this->dba->tableforwarder."_cmsImageMap (name,doc_id,image) values ("
			  .$this->dba->quote($name).",".$this->dba->quote($doc_id).",".$this->dba->quote($image).");");		}		else		{			return MAPNAME_EXISTS;		}	}		function getMaps ($doc_id)	{		$sth = $this->dba->query("select * from ".$this->dba->tableforwarder."_cmsImageMap where doc_id='$doc_id';");		if (is_object($sth))		{			$rows = $sth->fetch_rows_Array();			$sth->free();			return $rows;		}	}		function delMap ($name)	{		if ($this->dba->query("delete from ".$this->dba->tableforwarder."_cmsImageMapArea where name=".$this->dba->quote($name)))		{			return $this->dba->query("delete from ".$this->dba->tableforwarder."_cmsImageMap where name=".$this->dba->quote($name));		}	}		function addArea ($name, $coords, $descr, $shape, $href)	{		return $this->dba->query("insert into ".$this->dba->tableforwarder."_cmsImageMapArea (name,coords,descr,shape,href)"
		  ." values (".$this->dba->genQuotedFieldStr(array($name, $coords, $descr, $shape, $href)).")");	}		function delArea ($id)	{		$this->dba->query("delete from ".$this->dba->tableforwarder."_cmsImageMapArea where id='$id';");	}		function updateArea ($id, $name, $coords, $descr, $shape, $href)	{		$this->dba->query("update ".$this->dba->tableforwarder."_cmsImageMapArea set "
		  .$this->dba->genUpdateFieldStr(array('name'=>$name, 'coords'=>$coords, 'descr'=>$descr, 'shape'=>$shape, 'href'=>$href))
		  ." where id='$id';");	}	function getAreas ($name)	{		$sth = $this->dba->query("select * from ".$this->dba->tableforwarder."_cmsImageMapArea where name="
		  .$this->dba->quote($name).";");		if (is_object($sth))		{			$rows = $sth->fetch_rows_Array();			$sth->free();			return $rows;		}	}	function getArea ($id)	{		$sth = $this->dba->query("select * from ".$this->dba->tableforwarder."_cmsImageMapArea where id='$id';");		if (is_object($sth))		{			$row = $sth->fetch_row_Array();			$sth->free();			return $row;		}	} function getImage($id) {   $sth = $this->dba->query("select * from ".$this->dba->tableforwarder."_cmsImg where id='$id';");     if (is_object($sth))     {       $out = $sth->fetch_row_Array();       $sth->free();       return $out;     } }}?>